package com.zwj.learning.timetable.controller;

import com.zwj.common.R;
import com.zwj.learning.timetable.service.CourseService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/course")
public class CourseController {

    @Resource
    private CourseService courseService;

    @GetMapping("/getCourseByStudentId/{semester}/{semesterWeek}")
    public R<Object> getCourseByStudentId(
            @PathVariable String semester, @PathVariable String semesterWeek) {

        return R.success(
                courseService.getCourseByStudentId(semester, semesterWeek));

    }

    @GetMapping("/getCourseCount/{semester}")
    public R<Object> getCourseCount(@PathVariable String semester) {

       return R.success(courseService.getCourseCount(semester));
    }
}
